package com.RedRiver.hospitalsystem.personal_service.client;

import com.RedRiver.hospitalsystem.personal_service.client.param.AccountForm;
import com.RedRiver.hospitalsystem.personal_service.client.param.PageForm;
import com.RedRiver.hospitalsystem.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * contextId是项目名，name是client的名字
 */
@FeignClient(contextId = "AccountClient",name="personal-service",path="personalService/account")
public interface AccountClient {

    @GetMapping("/findAccount/{accountId}")
    Result findAccount(@PathVariable("accountId") Integer accountId);

    @PostMapping("/findAllAccount")
    Result<?> findAllAccount(@RequestBody PageForm form);

    @PostMapping("/createAccount")
    Result createAccount(@RequestBody AccountForm accountForm);

    @PostMapping("/updateAccount")
    Result updateAccount(@RequestBody AccountForm accountForm);

    @GetMapping("/delAccount/{accountId}")
    Result delAccount(@PathVariable("accountId") Integer accountId);
}
